Get XMLNodes
AutomatR.DeafultActivities.API.GetXMLNodes
The "Get XML Nodes" activity in AutomatR is designed to retrieve a list of nodes from a specified XML document. This versatile activity can take XML input as a string or read from a local XML file, allowing users to extract specific nodes based on their requirements.
Properties
Name | Description |
---|---|
Input | |
XML String | Specifies an XML string or string variable containing the XML to be processed. Either provide an XML string directly or use a string variable containing XML data. |
File Path | Specifies the full path of the XML file available on the local drive. Provide a string variable containing the file path. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Get XML Nodes" activity. This optional delay can be used to manage synchronization or pacing issues. Integer variables containing the delay duration (e.g., 5 for 5 seconds). |
Node Name | Specifies the name of the XML node to retrieve. This input is optional. If provided, the activity will return nodes with the specified name; otherwise, all nodes in the XML document will be retrieved. Provide a string variable containing the node name. |
Output | |
Nodes | Outputs a list of XML nodes based on the XML provided as input. The list contains XmlNode variables representing individual nodes. Variables of type List<XmlNode> to store the retrieved nodes. |
How to use:
- Drag and drop the "Get XML Nodes" activity onto the workflow.
- Configure the properties by providing either an XML string or the full path of the XML file.
- Optionally, configure the delay and specify the node name if you want to retrieve specific nodes.
- Execute the workflow to obtain a list of XML nodes.
Example: Consider an example where the "Get XML Nodes" activity is used to retrieve all book nodes from an XML file:
Get XML Nodes:
File Path: "C:\Documents\Books.xml"
Node Name: "book"
Delay: 3
Nodes: bookNodes
In this example, the activity reads the XML file located at "C:\Documents\Books.xml," waits for 3 seconds, and retrieves all nodes with the name "book." The list of book nodes is stored in the variable bookNodes
for further use in the workflow.